#include "View.h"

#include "QKeyEvent"

View::View(){ }
View::~View(){ /*delete this;*/ }

void View::keyPressEvent(QKeyEvent *event)
{
    if(Qt::Key::Key_C == event->key())
        emit moveUp();
    else if(Qt::Key::Key_V == event->key())
        emit moveDown();
    else if(Qt::Key::Key_D == event->key())
        emit duplicate();
    else if(Qt::Key::Key_R == event->key())
        emit remove();
    else if(Qt::Key::Key_T == event->key())
        emit restore();
    else if(Qt::Key::Key_N == event->key())
        emit create();
    else QTreeWidget::keyPressEvent(event);
}

void View::dropEvent(QDropEvent *event){
    QTreeWidget::dropEvent(event);
    QPoint point = event->pos();
    emit updateId(&point);
}
